﻿using System;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using ComponentRefCreator.Core;

namespace ComponentRefCreator
{
    public partial class frmGenerator : Form
    {
        public frmGenerator()
        {
            InitializeComponent();
        }

        private void btnGenerateComponentRefs_Click(object sender, EventArgs e)
        {
            try
            {
                WixParser parser = new WixParser(tbxXML.Text);

                using (frmOutput output = new frmOutput())
                {
                    output.ComponentRefs = parser.ParseComponentRefs();
                    output.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }

        private void btnClearXml_Click(object sender, EventArgs e)
        {
            tbxXML.Text = string.Empty;
        }

    }
}
